package dao;

import java.sql.SQLException;
import java.util.Scanner;
public class TestUpdate {
    public static void main(String[] args) {
        System.out.println("欢迎使用管理系统");

        System.out.println("请输入你要修改的学生姓名：");
        Scanner sc = new Scanner(System.in);
        String name = sc.next();
        System.out.println("请输入你要修改的学生性别：");
        String sex = sc.next();
        System.out.println("请输入你要修改的学生生日：");
        String birthday = sc.next();
        System.out.println("请输入你要修改的学生年龄：");
        int age = sc.nextInt();
        System.out.println("请输入你要修改的学生学号：");
        int id = sc.nextInt();
        System.out.println("请输入你要修改的学生编号：");
        int deptId = sc.nextInt();

        Emp emp = new Emp(deptId,name,age,sex,birthday);
        EmpDAO dao = new EmpDAO();

        try {
            dao.update(emp);
        } catch (ClassCastException | SQLException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        System.out.println("执行完毕");
    }

}